home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- #include "midi.h"
- #include "midiio.h"
- #include "malloc.h"
- #include "stdio.h"
-
- /* Turn your Indigo into the worlds most expensive MIDI thru box! */
-
- #define BUFSZ 1
-
- main(int argc, char **argv)
- {
- MIport *port;
- MIevent e[BUFSZ];
- MIconfig *c;
- u_int pbuf[2];
- int relative = 0;
- int i = 0;
-
- c = MInewconfig();
-
- if (argc > 1 && strcmp(argv[1],"-r") == 0) {
- relative = 1;
- pbuf[0] = MI_STAMPING;
- pbuf[1] = MIRELSTAMP;
- MIsetparams(c, pbuf, 2);
- }
-
- port = MInewport();
-
- if (MIopen(port, "rw", &c) < 0) {
- perror("open");
- exit(-1);
- }
-
- if (relative)
- MIsetstart(port, (struct timeval *) 0);
-
- while (1) {
- int retval;
-
- if ((retval = MIreceive(port, e, BUFSZ)) < 0) /* receive 1 event */
- {
- perror("receive");
- exit(-1);
- }
-
- if (retval > 0)
- retval = MIsend(port, e, retval);
-
- if (retval < 0) {
- exit(-1);
- }
- }
- }
-